The Palette Manager was designed to give the front-most window control over the color table of an indexed-color screen. The problem is that when a window that has changed the screen’s color table with a tolerant palette goes away, the palette colors stay in the screen’s color table. That’s not really a problem because if another window needed colors, then all it has to do is have its own palette and set that as the front-most window. But many people simply want to reset all of the screen’s color tables back to what they normally are, and that just won’t happen very easily through the Palette Manager.
This snippet shows how to restore all the screen’s color tables back to what they normally are using two different methods. To demonstrate this, set your main screen to eight bits per pixel and run the program and open the Flowers PICT file. A window that displays the contents of the PICT file appears on the main screen, and its color table should change to the one in the PICT file. The is controlled by a palette full of tolerant colors. Now close the window, and you’ll see that the screen’s color table does not get set back to the default color table. But if you go to the Display menu and choose either of the commands there, all the screen’s color tables should be restored back to what they normally are.
See the RestoreColorsPalette and RestoreColorsSlam routines in ColorReset.c for a description of how they work.